# Group Event Sub Topics

Event Sub Topics for Events. Can only be edited and entered by admins.


| Parameter | Description | Type | Required |
|:----------|-------------|------|----------|
| `name`  | Name of the event sub topic | string | - |
| `slug` | Slug of the event sub topic | string | - |

## Event Sub Topics Collection Get [/v1/event-topics/{event_topic_id}/event-sub-topics{?page%5bsize%5d,page%5bnumber%5d,sort}]
+ Parameters
    + event_topic_id: 1 (integer) - ID of the event topic.
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.

### List All Event Sub Topics [GET]
Get a list of Event Sub Topics.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "count": 1
          },
          "data": [
            {
              "relationships": {
                "events": {
                  "links": {
                    "self": "/v1/event-topics/1/relationships/events",
                    "related": "/v1/event-sub-topics/1/events"
                  }
                },
                "event-topic": {
                  "links": {
                    "self": "/v1/event-sub-topics/1/relationships/event-topic",
                    "related": "/v1/event-sub-topics/1/event-topic"
                  }
                }
              },
              "attributes": {
                "slug": "climbing",
                "name": "Climbing"
              },
              "type": "event-sub-topic",
              "id": "1",
              "links": {
                "self": "/v1/event-sub-topics/1"
              }
            }
          ],
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/event-topics/2/event-sub-topics"
          }
        }


## Event Sub Topics Collection Post [/v1/event-sub-topics{?page%5bsize%5d,page%5bnumber%5d,sort}]
+ Parameters
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.

### Create Event Sub Topic [POST]
Create a new event sub topic with name.

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "relationships":{
                    "event-topic":{
                        "data":{
                          "type":"event-topic",
                          "id":"1"
                        }
                    }
                },
                "attributes": {
                  "name": "Climbing"
                },
                "type": "event-sub-topic"
              }
            }

+ Response 201 (application/vnd.api+json)

        {
            "data": {
              "relationships": {
                "events": {
                  "links": {
                    "self": "/v1/event-topics/1/relationships/events",
                    "related": "/v1/event-sub-topics/1/events"
                  }
                },
                "event-topic": {
                  "links": {
                    "self": "/v1/event-sub-topics/1/relationships/event-topic",
                    "related": "/v1/event-sub-topics/1/event-topic"
                  }
                }
              },
              "attributes": {
                "name": "Climbing",
                "slug": "climbing"
              },
              "type": "event-sub-topic",
              "id": "1",
              "links": {
                "self": "/v1/event-sub-topics/1"
              }
            },
            "jsonapi": {
              "version": "1.0"
            },
            "links": {
              "self": "/v1/event-sub-topics/1"
            }
          }

## Event Sub Topic Details [/v1/event-sub-topics/{event_sub_topic_id}]
+ Parameters
    + event_sub_topic_id: 1 (integer) - ID of the event sub topic in the form of an integer

### Event Sub Topic Details [GET]
Get a single event sub topic.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
            "data": {
              "relationships": {
                "events": {
                  "links": {
                    "self": "/v1/event-topics/1/relationships/events",
                    "related": "/v1/event-sub-topics/1/events"
                  }
                },
                "event-topic": {
                  "links": {
                    "self": "/v1/event-sub-topics/1/relationships/event-topic",
                    "related": "/v1/event-sub-topics/1/event-topic"
                  }
                }
              },
              "attributes": {
                "name": "Climbing",
                "slug": "climbing"
              },
              "type": "event-sub-topic",
              "id": "1",
              "links": {
                "self": "/v1/event-sub-topics/1"
              }
            },
            "jsonapi": {
              "version": "1.0"
            },
            "links": {
              "self": "/v1/event-sub-topics/1"
            }
          }

### Update Event Sub Topic [PATCH]
+ `id` (integer) - ID of the record to update **(required)**

Update a single event topic by setting name.

Authorized user must be admin.

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "attributes": {
                  "name": "Climbing"
                },
                "type": "event-sub-topic",
                "id": "1"
              }
            }

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "events": {
                "links": {
                  "self": "/v1/event-topics/1/relationships/events",
                  "related": "/v1/event-sub-topics/1/events"
                }
              },
              "event-topic": {
                "links": {
                  "self": "/v1/event-sub-topics/1/relationships/event-topic",
                  "related": "/v1/event-sub-topics/1/event-topic"
                }
              }
            },
            "attributes": {
              "name": "Climbing",
              "slug": "climbing"
            },
            "type": "event-sub-type",
            "id": "1",
            "links": {
              "self": "/v1/event-sub-topics/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/event-sub-topics/1"
          }
        }

### Delete Event Sub Topic [DELETE]
Delete a single event sub topic.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }


## Event Sub Topic of an Event [/v1/events/{event_identifier}/event-sub-topic]
+ Parameters
    + event_identifier: 1 (string) - identifier or event id of the event. (b8324ae2 is an example of identifier)

### Event Sub Topic Details of an Event [GET]

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)


        {
            "data": {
                "relationships": {
                    "events": {
                        "links": {
                            "self": "/v1/event-topics/1/relationships/events",
                            "related": "/v1/event-sub-topics/1/events"
                        }
                    },
                    "event-topic": {
                        "links": {
                            "self": "/v1/event-sub-topics/1/relationships/event-topic",
                            "related": "/v1/event-sub-topics/1/event-topic"
                        }
                    },
                    "custom-placeholder": {
                        "links": {
                            "self": "/v1/event-sub-topics/1/relationships/custom-placeholder",
                            "related": "/v1/event-sub-topics/1/custom-placeholder"
                        }
                    }
                },
                "attributes": {
                    "name": "Climbing",
                    "slug": "climbing"
                },
                "type": "event-sub-topic",
                "id": "1",
                "links": {
                    "self": "/v1/event-sub-topics/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/event-sub-topics/1"
            }
        }



## Event Sub Topic of Custom Placeholder [/v1/custom-placeholders/{custom_placeholder_id}/event-sub-topic]
+ Parameters
    + custom_placeholder_id: 1 (integer) - ID of the Custom Placeholder in the form of an integer

### Event Sub Topic Details of Custom Placeholder [GET]

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)


        {
            "data": {
                "relationships": {
                    "events": {
                        "links": {
                            "self": "/v1/event-topics/1/relationships/events",
                            "related": "/v1/event-sub-topics/1/events"
                        }
                    },
                    "event-topic": {
                        "links": {
                            "self": "/v1/event-sub-topics/1/relationships/event-topic",
                            "related": "/v1/event-sub-topics/1/event-topic"
                        }
                    },
                    "custom-placeholder": {
                        "links": {
                            "self": "/v1/event-sub-topics/1/relationships/custom-placeholder",
                            "related": "/v1/event-sub-topics/1/custom-placeholder"
                        }
                    }
                },
                "attributes": {
                    "name": "Climbing",
                    "slug": "climbing"
                },
                "type": "event-sub-topic",
                "id": "1",
                "links": {
                    "self": "/v1/event-sub-topics/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/event-sub-topics/1"
            }
        }
